﻿@model IEnumerable<SocialNetwork.User>

@{
    ViewBag.Title = "List of users";
}

<h2>UsersList</h2>

<p>
    @Html.ActionLink("Create New", "CreateUser")
</p>
<table>
    <tr>
        <th>
            RoleId
        </th>
        <th>
            Username
        </th>
        <th>
            Email
        </th>
        <th>
            Password
        </th>
        <th>
            IsOnline
        </th>
        <th>
            RegDate
        </th>
        <th>
            LoginDate
        </th>
        <th>
            LogoffDate
        </th>
        <th>
            FirstName
        </th>
        <th>
            LastName
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.RoleId)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Username)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Email)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Password)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.IsOnline)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.RegDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LoginDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LogoffDate)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.FirstName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.LastName)
        </td>
        <td>
            @Html.ActionLink("Edit", "EditUser", new { id=item.Id }) |
            @Html.ActionLink("Details", "UserDetails", new { id=item.Id }) |
            @Html.ActionLink("Delete", "DeleteUser", new { id=item.Id })
        </td>
    </tr>
}

</table>
